package com.yulan.Tree;

/**
 * 114. 二叉树展开为链表
 */
public class LeetCode_114 {
    TreeNode pre = null;

    public void flatten(TreeNode root) {
        if(root == null)
            return;
        flatten(root.right);
        flatten(root.left);
        root.left = null;
        root.right = pre;
        pre = root;

    }
}
